package me.vudu.Conflict.Runnables.Skills;

import me.vudu.Conflict.ConflictPlugin;

import org.getspout.spoutapi.player.SpoutPlayer;

/**
 * behandelt folgende Skills
 * Regeneration 1
 * (Regeneration 2) not used
 * 
 * @author vwendel
 *
 */
public class PlayerRegenerationRunnable implements Runnable{
	
	@Override
	public void run() {
		  for(SpoutPlayer p: ConflictPlugin.players){
			  
			  if(!ConflictPlugin.isInEnemyBase(p, ConflictPlugin.isInBaseDamage)){
			  
				  if(ConflictPlugin.skillFightRegeneration.get(p.getName())>1){ //REgen 2 
					  p.setHealth(Math.min(20,p.getHealth()+2));
	   		   	  }else if(ConflictPlugin.skillFightRegeneration.get(p.getName())>0){ //Regen 1
	    			  p.setHealth(Math.min(20,p.getHealth()+1));
	    		  }
			  }
	    	   
	       }
	}

}
